package com.fwlst.module_home.model

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.fwlst.module_home.config.TabConfig
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch


class HomeTabViewModel : ViewModel() {
    private val _tabConfigs = MutableStateFlow<List<TabConfig>>(emptyList())
    val tabConfigs: StateFlow<List<TabConfig>> = _tabConfigs

    init {
        loadTabs()
    }

    private fun loadTabs() {
        viewModelScope.launch {
            // 示例：本地配置与网络配置结合
            val localTabs = TabConfig.DEFAULT_TABS
            _tabConfigs.value = localTabs.filter { it.visible }
        }
    }


}
